package exe;

import org.apache.ibatis.reflection.SystemMetaObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

@Controller
@RequestMapping("/local")
public class LocalExeCtrl {
    @RequestMapping("/test")
    public void test()throws Exception{
        Exception e=new Exception("test方法抛出异常....");
        throw e;
    }

    @ExceptionHandler(IOException.class)
    public ModelAndView e1(Exception e){
        System.out.println("这是局部异常。。。");
        return new ModelAndView("error","msg",e);
    }

}
